<template>
  <!-- 书籍详情页内容框架 -->
  <div class="bookDetails">
    <!-- 定义顶部导航栏 -->
    <book-details-top />
    <!-- 定义书籍介绍 -->
    <book-details-banner />
    <!-- 定义评论和推荐模块 -->
    <book-details-content />
    <!-- 定义页脚 -->
    <book-details-footer class="d-none d-md-block" />
    <!-- 定义移动端脚页 -->
    <div class="d-block d-md-none">
      <footer-text-s-m />
      <mobile-banner /> 
    </div>
  </div>
</template>

<script>
  import  BookDetailsTop from './BookDetailsComponents/BookDetailsTop'
  import  BookDetailsBanner from './BookDetailsComponents/BookDetailsBanner'
  import  BookDetailsContent from './BookDetailsComponents/BookDetailsContent'
  import  BookDetailsFooter from './BookDetailsComponents/BookDetailsFooter'
  import FooterTextSM from 'components/FooterText/FooterTextSM'
  import MobileBanner from 'components/Mobile/MobileBanner'

  export default {
    name: 'BookDetails',
    components: {
      BookDetailsTop,
      BookDetailsBanner,
      BookDetailsContent,
      BookDetailsFooter,
      FooterTextSM,
      MobileBanner
    },
    data () {
      return {
        
      }
    },
    mounted() {
      setTimeout(() => {
        // 通过Id获取书籍
        this.$store.dispatch('asynGetMobiBooksList');
      }, 50);
    },
    //在组件离开前修改跳转路由路径
    beforeRouteLeave (to, from, next) {
      // window.location.hash = '/details';
      next();
    }
  }

</script>

<style scoped>

</style>